<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>
    <style>.one{
        width:100px;
        height:100px;
        background: red;
    }</style>
    
</head>
<body>
    <!-- jquery 选择器 ajax -->
    <div class="one"></div>
    <button class="btn">ssss</button>
    <script>
    var $one=$(".one");
    console.log($one)
    $(".btn").click(function(){
        // $(".one").hide();
        if($(".one").is(":visible")){   
            $(".one").hide(300)
        }else
        {
            $(".one").show(300)
        }
    })
    </script>

</body>
</html>